package cn.nawang.ebeim.client.bean;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

public class UpDownloadFailedQueue {

  private static BlockingQueue<UpDownloadFailedBean> upDownloadFailedTaskQueue =
      new ArrayBlockingQueue<UpDownloadFailedBean>(ClientConfiguration.getQueueSize());

  public static BlockingQueue<UpDownloadFailedBean> getUpDownloadFailedBeanQueue() {
    return upDownloadFailedTaskQueue;
  }

  public static void enqueue(UpDownloadFailedBean task) throws InterruptedException {
      upDownloadFailedTaskQueue.put(task);
  }

  public static UpDownloadFailedBean dequeue() throws InterruptedException {
      return upDownloadFailedTaskQueue.take();
  }

  public static boolean isEmpty() {
    return upDownloadFailedTaskQueue.isEmpty();
  }
}
